package cn.edu.cqu.android.phone.domain;

// Generated 2011-10-7 15:57:37 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Contacts generated by hbm2java
 */
@Entity
@Table(name = "contacts", catalog = "myphone")
public class Contacts implements java.io.Serializable {

	private Integer id;
	private Users users;
	private String fullname;
	private String firstname;
	private String midname;
	private String lastname;
	private Date lastContactTime;
	private Integer contacttimes;
	private byte[] faceicon;
	private Set<Contactinfo> contactinfos = new HashSet<Contactinfo>(0);
	private Set<Sms> smses = new HashSet<Sms>(0);
	private Set<Contacttel> contacttels = new HashSet<Contacttel>(0);

	public Contacts() {
	}

	public Contacts(Users users, String fullname, String firstname,
			String midname, String lastname, Date lastContactTime,
			Integer contacttimes, byte[] faceicon,
			Set<Contactinfo> contactinfos, Set<Sms> smses,
			Set<Contacttel> contacttels) {
		this.users = users;
		this.fullname = fullname;
		this.firstname = firstname;
		this.midname = midname;
		this.lastname = lastname;
		this.lastContactTime = lastContactTime;
		this.contacttimes = contacttimes;
		this.faceicon = faceicon;
		this.contactinfos = contactinfos;
		this.smses = smses;
		this.contacttels = contacttels;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "owner")
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@Column(name = "fullname", length = 200)
	public String getFullname() {
		return this.fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	@Column(name = "firstname", length = 45)
	public String getFirstname() {
		return this.firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	@Column(name = "midname", length = 45)
	public String getMidname() {
		return this.midname;
	}

	public void setMidname(String midname) {
		this.midname = midname;
	}

	@Column(name = "lastname", length = 45)
	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastContactTime", length = 19)
	public Date getLastContactTime() {
		return this.lastContactTime;
	}

	public void setLastContactTime(Date lastContactTime) {
		this.lastContactTime = lastContactTime;
	}

	@Column(name = "contacttimes")
	public Integer getContacttimes() {
		return this.contacttimes;
	}

	public void setContacttimes(Integer contacttimes) {
		this.contacttimes = contacttimes;
	}

	@Column(name = "faceicon")
	public byte[] getFaceicon() {
		return this.faceicon;
	}

	public void setFaceicon(byte[] faceicon) {
		this.faceicon = faceicon;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contacts")
	public Set<Contactinfo> getContactinfos() {
		return this.contactinfos;
	}

	public void setContactinfos(Set<Contactinfo> contactinfos) {
		this.contactinfos = contactinfos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contacts")
	public Set<Sms> getSmses() {
		return this.smses;
	}

	public void setSmses(Set<Sms> smses) {
		this.smses = smses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contacts")
	public Set<Contacttel> getContacttels() {
		return this.contacttels;
	}

	public void setContacttels(Set<Contacttel> contacttels) {
		this.contacttels = contacttels;
	}

}
